package com.qianfeng.shoon.pet.utils;






import com.qianfeng.shoon.pet.BaseApp;

import java.io.File;

/**
 * Created by Administrator on 2015/10/9.
 */
public class FileUtils {
    //得到根目录
    public static String getRootCache() {
        File externalCacheDir = BaseApp.getInstance().getExternalCacheDir();
        if (!externalCacheDir.exists()) {
            externalCacheDir.mkdirs();
        }
        return externalCacheDir.getAbsolutePath();
    }
    //得到缓存图片的路径 返回图片文件
    public static File getImageCache()
    {
        String imageCache=getRootCache()+ File.separator+AppConfig.IMAGE_CACHE;
        File file=new File(imageCache);
        if(!file.exists())
        {
            file.mkdir();
        }
        return file;
    }
}
